//
//  NormalTableViewCell.swift
//  Health_Infomation
//
//  Created by 林帆 on 2017/8/18.
//  Copyright © 2017年 林帆. All rights reserved.
//

import UIKit

class NormalTableViewCell: UITableViewCell {

    lazy var TitleLabel = UILabel()
    lazy var dateLabel = UILabel()
    lazy var MainImageView = UIImageView()
    
    override func prepareForReuse() {//cell 被重用（一般是滚出视图外了）
        super.prepareForReuse()
//        MainImageView.image = nil
//        TitleLabel.text = nil
//        dateLabel.text = nil
    }
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        ConfigUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func awakeFromNib() {
        super.awakeFromNib()
//        ConfigUI()
        print("woqule")
    }
    
    func ConfigUI() {
        self.addSubview(TitleLabel)
        self.addSubview(dateLabel)
        self.addSubview(MainImageView)
        MainImageView.snp.makeConstraints { (make) in
            make.left.top.bottom.equalTo(self)
            make.width.equalTo(50)
        }
        
        TitleLabel.snp.makeConstraints { (make) in
            make.left.equalTo(MainImageView.snp.right).offset(10)
            make.top.equalTo(self).offset(10)
            make.height.equalTo(20)
            make.width.equalTo(100)
        }
        
        dateLabel.snp.makeConstraints { (make) in
            make.right.equalTo(self).offset(-10)
            make.bottom.equalTo(self).offset(-10)
            make.height.equalTo(20)
            make.width.equalTo(200)
        }
        
    }
  
}

